@extends('layout.layout')
@section('content')
 <h1 class="page-title">问题添加 <small></small></h1>
    <div class="widget">
    	<div class="widget">
                    <form action="{{url('/admin/service/doqsnadd')}}" method="post">
                        <div class="widget-header">
                            <h4>选择分区</h4>
                        </div>

                        <div>
                            <select class="span5" name="pid" id="select-box" style="background: rgba(0,0,0,0.5)">
                            		<option value="0">选择分区</option>
                             	 @foreach($parts as $k=>$v)
                                    <option value="{{$v->id}}">{{$v->partname}}</option>
                                 @endforeach   
                            </select>
                            <br />
                        </div>
                        <div class="widget-header">
                            <h4>选择分块</h4>
                        </div>
                        <div>
                            <select class="span5 a" name="cid" id="select-box" style="background: rgba(0,0,0,0.5)">
                            		<option value="0">选择分块</option>
                             	 @foreach($cates as $k=>$v)
                                    <option value="{{$v->id}}"  add="{{$v->pid}}">{{$v->catename}}</option>
                                 @endforeach   
                            </select>
                            <br />
                        </div>



                        <h4>问题标题</h4>
                        <input name="qtitle" class="span5" id="focusedInput" type="text" value="{{old('name')}}" />
                        <br />
                        
                       
					
						<div class="widget-header">
							<h4>回答内容</h4>
						</div> 
								<textarea name="qcontent" class="textarea input-block-level" id="wysihtml5" placeholder="请输入内容 ..." rows="12"></textarea>
                      
                        {{csrf_field()}}
                        <button type="submit" class="btn btn-primary icon-ok">添加</button>
                        <button type="reset" class="btn icon-refresh">重置</button>
                   
                    </form>

         </div>           
    </div> 
    <script type="text/javascript" src="/public/admin/js/jquery-1.8.3.min.js"> </script>
    <script type="text/javascript">

    $('select :first').change(function(){

            var id = $(this).val();

            $('.a').find('option').hide();
            $('.a').find('option[add='+id+']').show();
        })	
		

    </script>
@endsection


